import { View, StyleSheet } from 'react-native';
import { useLocalSearchParams, Stack } from 'expo-router';
import NewsList from '@/components/news/NewsList';

export default function CategoryScreen() {
  const { id, name } = useLocalSearchParams();
  
  return (
    <>
      <Stack.Screen 
        options={{
          title: name as string,
        }} 
      />
      <View style={styles.container}>
        <NewsList categoryId={Number(id)} />
      </View>
    </>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#f5f5f5',
  },
});